package Collection.List;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

public class ArrayListDemo {
    public static void main(String[] args) {
        List<String> strList =  new ArrayList<String>();
        strList.add("a");
        strList.add("b");
        strList.add("c");
        for(int i = 0; i < strList.size(); i++){
            String str = strList.get(i);
            System.out.println("str=" + str);
        }

        for(String str : strList){
            System.out.println(str);
        }

        Iterator<String> iterator = strList.iterator();
        while(iterator.hasNext()){
            System.out.println("迭代器"+iterator.next());
        }


        Vector vector = new Vector();
        vector.add("abc");
    }
}
